import Vue from 'vue'
import App from './App'
import request from './utils/request'

// 引入全局组件
import uniDrawer from "@/plugins/uni-drawer/uni-drawer.vue";// 抽屉
import wPicker from "@/plugins/w-picker/w-picker.vue";// 日期
import uniLoadMore from "@/plugins/uni-load-more/uni-load-more.vue";// 加载更多
import uniNoticeBar from "@/plugins/uni-notice-bar/uni-notice-bar.vue";// 通知
import uniPopup from "@/plugins/uni-popup/uni-popup/uni-popup.vue";// 弹框层
import region from "@/plugins/region/region.vue";// 弹框层

// 注册全局组件
Vue.component('uniDrawer',uniDrawer);
Vue.component('wPicker',wPicker);
Vue.component('uniLoadMore',uniLoadMore);
Vue.component('uniNoticeBar',uniNoticeBar);
Vue.component('uniPopup',uniPopup);
Vue.component('region',region);

// 提示框
const msg = (title, icon = 'none', duration = 1500, mask = false, ) => {
	//统一提示方便全局修改
	if (Boolean(title) === false) {
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}

Vue.config.productionTip = false
Vue.prototype.baseUrl = request.baseUrl
Vue.prototype.$http = request
Vue.prototype.$msg = msg

App.mpType = 'app'

const app = new Vue({
	...App
})
app.$mount()
